package com.cskaoyan.exception;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author stone
 * @date 2021/11/25 10:07
 */
@RestControllerAdvice
public class ExceptionControllerAdvice {

    @ExceptionHandler(CustomValidationException.class)
    public BaseRespVo valid(CustomValidationException exception) {
        String errmsg = exception.getErrmsg();
        return BaseRespVo.paramError(errmsg);
    }
}
